﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Specification
{
    public abstract class Not<T> : ISpecification<T>
    {
        protected string _Message;
        protected ISpecification<T> _Specification;
        public Not(ISpecification<T> Specification)
        {
            this._Specification = Specification;
        }

        public bool isSatisfiedBy(T objekt)
        {
            return !this._Specification.isSatisfiedBy(objekt);
        }

        public string Message
        {
            get { return this._Message; }
        }

        public ISpecification<T> remainderUnsatisfiedBy(T Candidate)
        {
            return isSatisfiedBy(Candidate) ? null : this._Specification.remainderUnsatisfiedBy(Candidate);
        }
    }
}
